package com.hl.toolkit.server.tycoin.common.enums;

/**
 * 下载任务类型
 *
 */
public enum DownloadTaskTypeEnum {
    DOWNLOAD_VIDEO(5, "视频"), DOWNLOAD_IMAGE(6, "图片");

    int key;
    String value;

    DownloadTaskTypeEnum(int key, String value) {
        this.key = key;
        this.value = value;
    }

    public int getKey() {
        return key;
    }

    public void setKey(int key) {
        this.key = key;
    }

    public String getValue() {
        return value;
    }

    public void setValue(String value) {
        this.value = value;
    }

    public static DownloadTaskTypeEnum getEnumByKey(int key) {
        for (DownloadTaskTypeEnum taskTypeEnum : DownloadTaskTypeEnum.values()) {
            if (key == taskTypeEnum.getKey()) {
                return taskTypeEnum;
            }
        }
        return null;
    }

}
